package newPan3d.ui
{
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.filters.GlowFilter;
	import flash.utils.getTimer;
	import flash.events.Event;
	
	public class UiView extends Sprite
	{
		private var _shadowBmp:Bitmap;
		private var _mapView:MapView;
		private var _fpsinfo:TextField;
		private var _lastTime:int;
		private var _fNum:Number=0;
		public function UiView()
		{
			super();
			addPics();
			addMaps();
			addTexts();
		}
		
		private function addMaps():void
		{
			_mapView=new MapView;
			_mapView.y=100;
			_mapView.x=1024-100;
			_mapView.scaleX=0.5
			_mapView.scaleY=-0.5;
			addChild(_mapView);
		}
		private function addTexts():void
		{
			_fpsinfo=new TextField()
			addChild(_fpsinfo);
			this.addEventListener(Event.ENTER_FRAME,enterFrame)
		}
		private function enterFrame(evt:Event):void
		{
			var cc:int=getTimer()-_lastTime;
			_fNum++
			if(cc>=1000){
				_fpsinfo.htmlText="<font color='#ffffff' face='宋体'>fps: " + _fNum + "</font>";
				_fpsinfo.filters = [new GlowFilter(0x000000, 1, 2, 2, 17, 1, false, false)];
				_lastTime=getTimer();
				_fNum=0;
			}
			
		}
		
		
		private function addPics():void
		{
			_shadowBmp=new Bitmap;
			_shadowBmp.scaleX=_shadowBmp.scaleY=0.3;
			//addChild(_shadowBmp);
		}

		public function get shadowBmp():Bitmap
		{
			return _shadowBmp;
		}

		public function get mapView():MapView
		{
			return _mapView;
		}


	}
}